<script type="text/javascript">
    function ajaxsubmit(self){
        if ($(self).hasClass('ed')) {
            return false;
        }
        $(self).addClass('ed');
        var obj = showMyLoading();
        $.post($(self).attr('action'), $(self).serialize(), function(data){
            hideMyLoading(obj);
            layer.msg(data.info);
            if (data.status == 'y') {
                window.location.reload();
            } else {
                $(self).removeClass('ed');
            }
        }, 'json');
    }
</script>
<div class="ibox-content">
    <form name="form" action="{:url('saveSort')}"  method="post" onsubmit="ajaxsubmit(this);return false;" >
        <table class="table table-hover">
            <thead>
            <tr>
                <th>名称</th>
                <th>排序</th>
                <th>市</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="li"}
            <tr>
                <td>{$li.title}</td>
                <td>
                    <input type="text"  style="width:60px;text-align:center;" name="{$li.id}" value="{$li.sort}" class="form-control">
                </td>
                <td>
                    <a href="{empty name='t'}javascript:;{else/}{:url('index',array('id'=>$li['id'],'type'=>$t))}{/empty}" class="label label-warning">{$li.count}</a>
                </td>
                <td>
                    <a href="{:url('save',['id'=>$li['id'],'type'=>$type])}" class="btn btn-primary btn-xs edit"><i class="fa fa-edit"></i> 编辑</a>
                    <a href="javascript:;" onclick="return del({$li.id});" class="btn btn-danger btn-xs delete"><i class="fa fa-trash-o"></i> 删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
            <tfoot>
            <tr>
                <td>&nbsp;</td>
                <td colspan="3">
                    <input type="submit" class="btn btn-sm btn-primary m-t-n-xs" value="修改排序" />
                </td>
            </tr>
            </tfoot>
        </table>
    </form>
</div>